<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>2-组件注册注意事项上</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
    <style></style>
  </head>
  <body>
    <div id="app">
      <button-count></button-count>
      <button-count></button-count>
    </div>
    <script>
      Vue.component('button-count', {
        data: function () {
          return {
            count: 0,
          };
        },
        template: `
                <button @click="handle">点击了{{count}}次</button>
        `,
        methods: {
          handle: function () {
            this.count += 3;
          },
        },
      });
      var vm = new Vue({
        el: '#app',
        data: {},
        methods: {},
      });
    </script>
  </body>
</html>
